/*    */ package com.zimbra.cs.redolog.op;
/*    */ 
/*    */ import com.zimbra.cs.mailbox.CalendarItem;
/*    */ import com.zimbra.cs.mailbox.Mailbox;
/*    */ import com.zimbra.cs.mailbox.MailboxManager;
/*    */ import com.zimbra.cs.mailbox.MailboxOperation;
/*    */ import com.zimbra.cs.mailbox.OperationContext;
/*    */ import com.zimbra.cs.redolog.RedoLogInput;
/*    */ import com.zimbra.cs.redolog.RedoLogOutput;
/*    */ import java.io.IOException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class FixCalendarItemPriority
/*    */   extends RedoableOp
/*    */ {
/*    */   private int mId;
/*    */   
/*    */   public FixCalendarItemPriority()
/*    */   {
/* 35 */     super(MailboxOperation.FixCalendarItemPriority);
/*    */   }
/*    */   
/*    */   public FixCalendarItemPriority(int mailboxId, int itemId) {
/* 39 */     this();
/* 40 */     setMailboxId(mailboxId);
/* 41 */     this.mId = itemId;
/*    */   }
/*    */   
/*    */   protected String getPrintableData() {
/* 45 */     StringBuilder sb = new StringBuilder("id=");
/* 46 */     sb.append(this.mId);
/* 47 */     return sb.toString();
/*    */   }
/*    */   
/*    */   protected void serializeData(RedoLogOutput out) throws IOException {
/* 51 */     out.writeInt(this.mId);
/*    */   }
/*    */   
/*    */   protected void deserializeData(RedoLogInput in) throws IOException {
/* 55 */     this.mId = in.readInt();
/*    */   }
/*    */   
/*    */   public void redo() throws Exception {
/* 59 */     Mailbox mbox = MailboxManager.getInstance().getMailboxById(getMailboxId());
/* 60 */     OperationContext octxt = getOperationContext();
/* 61 */     CalendarItem calItem = mbox.getCalendarItemById(octxt, this.mId);
/* 62 */     if (calItem != null) {
/* 63 */       mbox.fixCalendarItemPriority(octxt, calItem);
/*    */     }
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/redolog/op/FixCalendarItemPriority.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */